package com.bifang.common.constant.enums.common;
/**
 * 权限类型
 *
 * @author chenzh
 * @date 2018-08-12
 */
public enum ObjectTypeEnum {
    role("role", "角色权限"),
    router("router", "路由/菜单权限"),
    router_function("router-function", "路由功能方法权限"),
    function("function", "功能方法权限"),
    system("system", "系统级权限"),
    org("org", "组织权限"),
    app_menu("app-menu", "app菜单"),
    label("label", "标签"),
    act("act", "工作流节点"),
    user_group("user_group", "用户组");
    private String type;
    private String name;

    ObjectTypeEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return this.type;
    }

    public String getName() {
        return this.name;
    }

    public static ObjectTypeEnum getByType(String type) {

        for (ObjectTypeEnum typeEnum : values()) {
            if (typeEnum.getType().equals(type)) {
                return typeEnum;
            }
        }
        return null;
    }
}
